﻿@model PdfReceiptHeaderFooterModel
@using SmartStore.Web.Framework.Pdf;

@{
    Layout = ViewBag.IsPartial == true ? "" : "_Print";

    var company = Model.MerchantCompanyInfo;
    var bank = Model.MerchantBankAccount;
    var contact = Model.MerchantContactData;

}

<footer>
	
    @{ Html.RenderWidget("invoice_footer_before"); }

	<table class="text-muted text-smallest">
		<tr>
			<td style="width: 33%;">
				@Html.Raw(Model.MerchantFormattedAddress)
			</td>
			<td style="width: 33%;">
				<div>@T("PDFInvoice.Footer.Url", Model.StoreUrl)</div>
				@if (contact.ContactEmailAddress.HasValue())
				{
					<div>@T("PDFInvoice.Footer.Mail", contact.ContactEmailAddress)</div>
				}
				@if (contact.CompanyTelephoneNumber.HasValue())
				{
					<div>@T("PDFInvoice.Footer.Fon", contact.CompanyTelephoneNumber)</div>
				}
				@if (contact.CompanyFaxNumber.HasValue())
				{
					<div>@T("PDFInvoice.Footer.Fax", contact.CompanyFaxNumber)</div>
				}
				@if (company.TaxNumber.HasValue())
				{
					<div>@T("PDFInvoice.TaxNumber") @company.TaxNumber</div>
				}
				@if (company.VatId.HasValue())
				{
					<div>@T("PDFInvoice.VatId") @company.VatId</div>
				}
				@if (company.CommercialRegister.HasValue())
				{
					<div>@T("PDFInvoice.CommercialRegisterHeading") @company.CommercialRegister</div>
				}
			</td>
			<td style="width: 33%;">
				@if (bank.Bankname.HasValue())
				{
					<div>@bank.Bankname</div>
				}
				@if (bank.Bankcode.HasValue())
				{
					<div>@T("PDFInvoice.Footer.Bankcode", bank.Bankcode)</div>
				}				
				@if (bank.AccountNumber.HasValue())
				{
					<div>@T("PDFInvoice.Footer.AccountNumber", bank.AccountNumber)</div>
				}					
				@if (bank.AccountHolder.HasValue())
				{
					<div>@T("PDFInvoice.Footer.AccountHolder", bank.AccountHolder)</div>
				}					
				@if (bank.Iban.HasValue())
				{
					<div>@T("PDFInvoice.Footer.Iban", bank.Iban)</div>
				}					
				@if (bank.Bic.HasValue())
				{
					<div>@T("PDFInvoice.Footer.Bic", bank.Bic)</div>
				}						
			</td>
		</tr>
	</table>

	@{ Html.RenderWidget("invoice_footer_after"); }

</footer>

